<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Useranalyse extends CI_Controller {
	function __construct(){
		parent::__construct();
		$this->load->library('Huashang/user');
		$this->user->checkLogin();
	}
	// 下注分析
	public function bet()
    {
        $data = array();
        $this->load->view('useranalyse/bet', $data);
    }
	// 下注分析列表
    public function get_bet_list()
    {
    	echo json_encode(
            array(
                'total' =>  1,
                'rows'  =>  array(
                    array('username'=>52493,'agent'=>'mlldefaultdl','total_bet'=>430.00,'total_valid_bet'=>430.00,'win'=>207.90,'total_count'=>43, 'win_count'=>5,'lose_count'=>35,'win_percent'=>'11.63%','level'=>'低','result'=>-233)
                )
            ), JSON_UNESCAPED_UNICODE);
    }

    public function effective_user()
    {
        $data = array();
        $this->load->view('useranalyse/effective_user', $data);
    }

    public function analysis_cash()
    {
        $data = array();
        $this->load->view('useranalyse/analysis_cash', $data);
    }

    public function get_effective_user()
    {
        echo <<<content
{
    "total": 1, 
    "rows": [
        {
            "sort": 1, 
            "date": "2017-3-2", 
            "effective_num":233 , 
            "new_num":33, 
            "man_in": 43, 
            "com_in": 43, 
            "card_in": 33, 
            "online_in": 5, 
            "man_out": 35, 
            "online_out": 22,
            "res": 0 
        }
    ]
}
content;

    }

    public function get_analysis_cash()
    {
//        echo <<<content
//{
//    "total": 3,
//    "rows": [
//        {
//            "username": "username",
//            "money": 555,
//            "discount_amount":88,
//            "valid_num":55
//        },
//         {
//            "username": "username2",
//            "money": 555,
//            "discount_amount":88,
//            "valid_num":55
//        },
//        {
//            "username": "username3",
//            "money": 555,
//            "discount_amount":88,
//            "valid_num":55
//        }
//    ]
//}
//content;
        echo json_encode(
            array(
                'total' =>  2,
                'rows'  =>  array(
                    array('username'=>'czm126',
                        'company_in_total_money'=>193322.000,
                        'company_in_discount_money'=>1233.000,
                        'company_in_num'=>23,
                        'online_in_total_money'=>1111,
                        'online_in_discount_money'=>1111,
                        'online_in_num'=>11,
                        'manual_in_total_money'=>6666,
                        'manual_in_discount_money'=>666,
                        'manual_in_num'=>66,
                        'coupon_total_money'=>666,
                        'coupon_num'=>6666,
                        'manual_out_total_money'=>6666,
                        'manual_out_num'=>6666,
                        'online_out_total_money'=>6666,
                        'online_out_num'=>6666
                    ),
                    array('username'=>'cj134597',
                        'company_in_total_money'=>11111,
                        'company_in_discount_money'=>1111,
                        'company_in_num'=>11,
                        'online_in_total_money'=>111,
                        'online_in_discount_money'=>11,
                        'online_in_num'=>11,
                        'manual_in_total_money'=>1111,
                        'manual_in_discount_money'=>1111,
                        'manual_in_num'=>22222,
                        'coupon_total_money'=>3333,
                        'coupon_num'=>55555,
                        'manual_out_total_money'=>77777,
                        'manual_out_num'=>77777,
                        'online_out_total_money'=>777777,
                        'online_out_num'=>77777
                    )
                )
            ), JSON_UNESCAPED_UNICODE);

    }

    // 会员查询
	public function member_check()
    {
        $data = array();
        $this->load->view('useranalyse/member_check', $data);
    }

    // 会员查询列表
    public function get_member_check_list()
    {
    	echo json_encode(
            array(
                'total' =>  1,
                'rows'  =>  array(
                    array('t1'=>52493,'t2'=>'mlldefaultdl','t3'=>430.00,'t4'=>430.00,'t5'=>207.90,'t6'=>43, 't7'=>5,'t8'=>'qq.com','t9'=>'1234567')
                )
            ), JSON_UNESCAPED_UNICODE);
    }

    // 优惠分析
	public function privilege_analyse()
     {
         $data = array();
       $this->load->view('useranalyse/privilege_analyse', $data);
     }
 
    // 优惠分析列表
    public function get_privilege_analyse_list()
	{
     	echo json_encode(
             array(
                 'total' =>  2,
                 'rows'  =>  array(
                    array('t1'=>'g2458890g','t2'=>'L0001','t3'=>8.115,'t4'=>8.115),
                    array('t1'=>'yy2636710','t2'=>'L0001','t3'=>6.465,'t4'=>6.465),
                    array('t1'=>'总人数：2人','t2'=>'总计','t3'=>15.666,'t4'=>15.666),
                 )
             ), JSON_UNESCAPED_UNICODE);
     }

     // 会员统计
	public function member_statistics()
     {
         $data = array();
       $this->load->view('useranalyse/member_statistics', $data);
     }
 
    // 会员统计列表
    public function get_member_statistics_list()
	{
     	echo json_encode(
             array(
                 'total' =>  1000,
                 'rows'  =>  array(
                    array('t1'=>'燕子','t2'=>12345,'t3'=>'2017-03-08 09:45:41','t4'=>'2017-03-08 09:45:41 / 115.46.142.106','t5'=>0,'t6'=>1,'t7'=>0,'t8'=>0,'t9'=>0,'t10'=>1,'t11'=>0,'t12'=>0)
 
                 )
             ), JSON_UNESCAPED_UNICODE);
     }
     
	
}